<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var person = {
            uname:'ArimaMisaki',
            age:22
        }
        console.log(person);

        //1. 访问属性
        // 方式1 利用对象.属性
        console.log(person.uname);
        // 方式2 利用对象.["属性"]
        console.log(person["uname"]);
        
        //2. 修改属性：访问并修改即可
        person.uname = 'AM'
        console.log(person.uname);

        //3. 添加属性：直接对象.属性即可
        person.sex = '男'
        console.log(person.sex);
        console.log(person);

        //4. 删除属性：delete 对象.属性
        delete person.sex
        console.log(person);

        //5. 遍历对象中的属性
        for(var a in person){
            console.log(a);
        }
    </script>
</body>
</html>